<!--
 * @Author: shawnXiao
 * @Date: 2021-12-18 19:54:33
 * @LastEditTime: 2022-01-05 10:16:38
 * @FilePath: /vite2-vue3-typescript/src/App.vue
-->

<script lang="ts">
// antd-vue 组件库国际化
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enUS from 'ant-design-vue/lib/locale-provider/en_US'
import { defineComponent, ref } from 'vue'
import moment from 'moment' // moment 国际化
import store from '@/store'
export default defineComponent({
  components: {},
  setup() {
    let locale: any = ref(null)

    const lang: string = store.getters['app/language']
    locale = lang === 'en' ? enUS : zhCN
    moment.locale(lang === 'enUS' ? 'en' : 'zh_cn')

    return {
      locale,
    }
  },
})
</script>
<template>
  <a-config-provider :locale="locale">
    <router-view></router-view>
  </a-config-provider>
</template>
<style lang="less" scoped></style>
